package com.atguigu.gmall.payment.controller;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.payment.config.AlipayConfig;
import com.atguigu.gmall.payment.service.PaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author: atguigu
 * @create: 2023-03-14 09:20
 */
@RestController
@RequestMapping("/api/payment")
public class PaymentController {

    @Autowired
    private PaymentService paymentService;


    /**
     * 处理各种支付方式
     * @param orderId
     * @param payType
     * @return
     */
    @GetMapping("/pay")
    public Result pay(Long orderId, String payType) {
        paymentService.pay(orderId, payType);
        return Result.ok();
    }

}
